#include "eye_detector.hpp"

void detectAndDrawEyes(cv::Mat &img, const cv::Mat &faceROI, const cv::Rect &face, cv::CascadeClassifier &eye_cascade)
{
    std::vector<cv::Rect> eyes;
    eye_cascade.detectMultiScale(faceROI, eyes, 1.1, 2, 0 | cv::CASCADE_SCALE_IMAGE, cv::Size(30, 30));
    for (const auto &eye : eyes)
    {
        cv::Point eyeCenter(face.x + eye.x + eye.width / 2, face.y + eye.y + eye.height / 2);
        int radius = cvRound((eye.width + eye.height) * 0.25);
        cv::circle(img, eyeCenter, radius, cv::Scalar(255, 0, 0), 2);
    }
}

